package com.live.dengdengtv.net;

import com.google.gson.Gson;
import com.live.dengdengtv.bean.SimpleInfoMap;
import com.live.dengdengtv.utils.Lo;
import com.zhy.http.okhttp.callback.Callback;

import okhttp3.Call;
import okhttp3.Response;

/**
 * Created by wyf on 2016/8/2.
 */
public abstract class BaseInfoMapCallback extends Callback<SimpleInfoMap> {

    @Override
    public SimpleInfoMap parseNetworkResponse(Response response, int id) throws Exception {

        String string = response.body().string();

        Lo.i(getTag(), string);

        SimpleInfoMap baseInfoBean = new Gson().fromJson(string, SimpleInfoMap.class);
        return baseInfoBean;
    }

    public String getTag(){
        return "BaseInfoMapCallback";
    }

    @Override
    public void onError(Call call, Exception e, int id) {

    }
}
